package com.ruoyi.common.enums;

/**
 * @author sunli
 * @date 2024/12/23 9:59
 * @desc
 **/
public enum  RolesEnums {

    // 超级管理员
    //普通角色
    //运输公司管理员
    //区县主审员
    //区县主审员
    //区县初审员
    //市级初审员
    //执法人员
    //司机
        ADMIN("admin", 1l),
        COMMON("common", 2l),
        YUN_SHU_ADMIN("yun_shu_admin", 91l),
        DISTRICT_ZHU_SHEN("district_zhu_shen", 117l),
        CITY_ZHU_SHEN("city_zhu_shen", 118l),
        DISTRICT_CHU_SHEN("district_chu_shen", 119l),
        CITY_CHU_SHEN("city_chu_shen", 120l),
        ZHI_FA("zhi_fa", 121l),
        DRIVER("driver", 122l);

        private final String roleKey;
        private final Long roleId;



        /**
         *  通过当前用户角色id 获取权限key
         * @param roleId 角色id
         */
        public static String getRoleKeyByRoleId(Long roleId){
            for (RolesEnums rolesEnums : RolesEnums.values()) {
                if (rolesEnums.getRoleId()==roleId){
                    return rolesEnums.getRoleKey();
                }
            }
            return null;
        }

        RolesEnums(String roleKey, Long roleId) {
            this.roleKey = roleKey;
            this.roleId = roleId;
        }

        public String getRoleKey() {
            return roleKey;
        }

        public Long getRoleId() {
            return roleId;
        }
}
